package com.samshow.res.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Created by niwb on 2017/3/20.
 */
@Entity
@Table(name = "t_program_area", schema = "mydb")
public class TProgramAreaEntity {
    private int nId;
    private Integer nPId;
    private Integer x;
    private Integer y;
    private Integer nWidth;
    private Integer nHeight;
    private Byte nType;
    private String nRemark;

    @Id
    @Column(name = "N_ID")
    public int getnId() {
        return nId;
    }

    public void setnId(int nId) {
        this.nId = nId;
    }

    @Basic
    @Column(name = "N_P_ID")
    public Integer getnPId() {
        return nPId;
    }

    public void setnPId(Integer nPId) {
        this.nPId = nPId;
    }

    @Basic
    @Column(name = "X")
    public Integer getX() {
        return x;
    }

    public void setX(Integer x) {
        this.x = x;
    }

    @Basic
    @Column(name = "Y")
    public Integer getY() {
        return y;
    }

    public void setY(Integer y) {
        this.y = y;
    }

    @Basic
    @Column(name = "N_WIDTH")
    public Integer getnWidth() {
        return nWidth;
    }

    public void setnWidth(Integer nWidth) {
        this.nWidth = nWidth;
    }

    @Basic
    @Column(name = "N_HEIGHT")
    public Integer getnHeight() {
        return nHeight;
    }

    public void setnHeight(Integer nHeight) {
        this.nHeight = nHeight;
    }

    @Basic
    @Column(name = "N_TYPE")
    public Byte getnType() {
        return nType;
    }

    public void setnType(Byte nType) {
        this.nType = nType;
    }

    @Basic
    @Column(name = "N_REMARK")
    public String getnRemark() {
        return nRemark;
    }

    public void setnRemark(String nRemark) {
        this.nRemark = nRemark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TProgramAreaEntity that = (TProgramAreaEntity) o;

        if (nId != that.nId) return false;
        if (nPId != null ? !nPId.equals(that.nPId) : that.nPId != null) return false;
        if (x != null ? !x.equals(that.x) : that.x != null) return false;
        if (y != null ? !y.equals(that.y) : that.y != null) return false;
        if (nWidth != null ? !nWidth.equals(that.nWidth) : that.nWidth != null) return false;
        if (nHeight != null ? !nHeight.equals(that.nHeight) : that.nHeight != null) return false;
        if (nType != null ? !nType.equals(that.nType) : that.nType != null) return false;
        if (nRemark != null ? !nRemark.equals(that.nRemark) : that.nRemark != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = nId;
        result = 31 * result + (nPId != null ? nPId.hashCode() : 0);
        result = 31 * result + (x != null ? x.hashCode() : 0);
        result = 31 * result + (y != null ? y.hashCode() : 0);
        result = 31 * result + (nWidth != null ? nWidth.hashCode() : 0);
        result = 31 * result + (nHeight != null ? nHeight.hashCode() : 0);
        result = 31 * result + (nType != null ? nType.hashCode() : 0);
        result = 31 * result + (nRemark != null ? nRemark.hashCode() : 0);
        return result;
    }
}
